cmake_minimum_required(VERSION 3.10)

# set(CMAKE_C_COMPILER "/usr/bin/aarch64-linux-gnu-gcc")
# set(CMAKE_CXX_COMPILER "/usr/bin/aarch64-linux-gnu-g++")
# set(CMAKE_FIND_ROOT_PATH "/usr/bin/aarch64-linux-gnu")
set(CMAKE_C_COMPILER "/home/congzhang/workspace/record/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc")
set(CMAKE_CXX_COMPILER "/home/congzhang/workspace/record/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++")
set(CMAKE_FIND_ROOT_PATH "/home/congzhang/workspace/record/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu")

set(SHARE_LIB_CURL  ${CMAKE_SOURCE_DIR}/thirdlib/curl/lib/libcurl.so.4.8.0)
set(SHARE_LIB_ZMQ  ${CMAKE_SOURCE_DIR}/thirdlib/libzmq/lib/libzmq.so.5.2.4)
set(SHARE_LIB_OPENSSL ${CMAKE_SOURCE_DIR}/thirdlib/openssl/lib/libssl.so.3)
set(SHARE_LIB_CRYPTO ${CMAKE_SOURCE_DIR}/thirdlib/openssl/lib/libcrypto.so.3)

set(BUILD_SHARED_LIBS on)
set(CMAKE_VERBOSE_MAKEFILE off)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/out)
set(CMAKE_CXX_FLAGS -std=c++11)
# set(CMAKE_PREFIX_PATH /workspace/record/usr/local)
# set(CMAKE_INSTALL_BINDIR /workspace/record/usr/local/bin)
# set(CMAKE_INSTALL_LIBDIR /workspace/record/usr/local/lib)

project("recordbusiness")

#运行环境路径添加
link_directories(/usr/local/lib)
include_directories(/usr/local/include)

#编译环境路径添加
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/thirdlib)
include_directories(${CMAKE_SOURCE_DIR}/thirdlib/curl/include)
include_directories(${CMAKE_SOURCE_DIR}/thirdlib/libzmq/include)
include_directories(${CMAKE_SOURCE_DIR}/thirdlib/json/include)
include_directories(${CMAKE_SOURCE_DIR}/thirdlib/openssl/include)
include_directories(${CMAKE_SOURCE_DIR}/thirdlib/minio-cpp-sdk/src)

install(FILES
    ${SHARE_LIB_CURL}
    ${SHARE_LIB_ZMQ}
    ${SHARE_LIB_OPENSSL}
    ${SHARE_LIB_CRYPTO}
    CONFIGURATIONS Release Debug Coverage Profile
    RUNTIME DESTINATION lib
)

#添加宏控制
#add_definitions(-DUSE_C_TIME)

#添加子目录
add_subdirectory(thirdlib)
add_subdirectory(common)
add_subdirectory(business)
add_subdirectory(scripts)
